﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;
using Cloak.Mvp;

namespace Cloak.Web.Mvp
{
	/// <summary>
	/// Arguments to handlers of events indicating a control is ready to be presented
	/// </summary>
	public class PresentableEventArgs : EventArgs
	{
		/// <summary>
		/// A presentation with no presenters
		/// </summary>
		public new static readonly PresentableEventArgs Empty = new PresentableEventArgs();

		/// <summary>
		/// Initializes arguments with no presentation
		/// </summary>
		public PresentableEventArgs()
		{
			Presentation = new ViewPresentation();
		}

		/// <summary>
		/// Initializes arguments with the specified presentation
		/// </summary>
		/// <param name="presentation">The presentation to be applied to the view</param>
		public PresentableEventArgs(ViewPresentation presentation)
		{
			Contract.Requires(presentation != null);

			Presentation = presentation;
		}

		/// <summary>
		/// Gets the presentation to be applied to the view
		/// </summary>
		public ViewPresentation Presentation { get; private set; }
	}
}